home *** CD-ROM | disk | FTP | other *** search
/ cyber.net interactivo 1997 January / inter@ivo 1997-01.iso / cybint12 / bin / dirutil.dxr / 00001.ls next >
Encoding:
Text File  |  1996-12-14  |  2.3 KB  |  123 lines

  1. on startMovie
  2.   openDirutil()
  3.   if xfactoryList("Fileio") = EMPTY then
  4.     openXLib("FileIO")
  5.   end if
  6. end
  7.  
  8. on stopMovie
  9.   if xfactoryList("Fileio") <> EMPTY then
  10.     closeXLib("FileIO")
  11.   end if
  12.   closeDirUtil()
  13. end
  14.  
  15. on openDirutil
  16.   global x
  17.   openXLib("DirUtil")
  18.   set x to DirUtil(mnew)
  19. end
  20.  
  21. on closeDirUtil
  22.   global x
  23.   x(mdispose)
  24.   closeXLib("DirUtil")
  25. end
  26.  
  27. on QTVersion
  28.   global x
  29.   put x(mQTVersion) into field "QTVersion"
  30. end
  31.  
  32. on qtversionstring
  33.   global x
  34.   put x(mQTVersionStr) into field "QTVersionString"
  35. end
  36.  
  37. on setattrib aFilename
  38.   global x
  39.   if voidp(aFilename) then
  40.     set f to FileIO(mnew, "?read", "*")
  41.     if objectp(f) then
  42.       set aFilename to f(mFileName)
  43.       f(mdispose)
  44.     end if
  45.   end if
  46.   if not voidp(aFilename) then
  47.     x(mSetAttrib, aFilename, 0)
  48.   end if
  49. end
  50.  
  51. on getattrib aFilename
  52.   global x
  53.   if voidp(aFilename) then
  54.     set f to FileIO(mnew, "?read", "*")
  55.     if objectp(f) then
  56.       set aFilename to f(mFileName)
  57.       f(mdispose)
  58.     end if
  59.   end if
  60.   if not voidp(aFilename) then
  61.     set at to x(mGetAttrib, aFilename)
  62.   else
  63.     set at to "No Filename"
  64.   end if
  65.   put at into field "Attribute"
  66. end
  67.  
  68. on getdrivetype adrivenum
  69.   global x, drives
  70.   set drives to ["DRIVE_UNDETERMINED", "DRIVE_NOTEXIST", "DRIVE_REMOVABLE", "DRIVE_FIXED", "DRIVE_REMOTE"]
  71.   if voidp(adrivenum) then
  72.     set adrivenum to value(field "DriveNum")
  73.   end if
  74.   set drtypeno to x(mGetDriveType, adrivenum)
  75.   set drtype to getAt(drives, drtypeno + 1)
  76.   put drtype into field "DriveType"
  77. end
  78.  
  79. on WhereISCDRom
  80.   global x
  81.   set hit to 0
  82.   set count to 0
  83.   repeat while (hit = 0) or (count < 50)
  84.     if x(mIsCdrom, count) then
  85.       set hit to 1
  86.       set driveLetter to numToChar(count + 65)
  87.     end if
  88.     set count to count + 1
  89.   end repeat
  90.   if hit = 0 then
  91.     set driveLetter to "No CDROM Found"
  92.   end if
  93.   put driveLetter & ":" into field "CD-ROM"
  94. end
  95.  
  96. on authors
  97.   global x
  98.   put x(mAuthors) into field "Author Info"
  99. end
  100.  
  101. on seterroron
  102.   global x
  103.   x(mSetErrorMode, 1)
  104. end
  105.  
  106. on seterroroff
  107.   global x
  108.   x(mSetErrorMode, 0)
  109. end
  110.  
  111. on testerrors
  112.   WhereISCDRom()
  113.   set cdpath to field "CD-ROM"
  114.   put cdpath
  115.   set errortest to FileIO(mnew, "read", cdpath & "\Garbage.txt")
  116.   if objectp(errortest) then
  117.     alert("IT's found")
  118.     errortest(mdispose)
  119.   else
  120.     alert("It's not found")
  121.   end if
  122. end
  123.